﻿using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace NWT
{
	public partial class HelpLabel : UserControl
	{
		/// <summary>
		/// Constructor
		/// </summary>
		public HelpLabel()
		{
			InitializeComponent();
		}

		/// <summary>
		/// Help index
		/// </summary>
		private string helpItem = string.Empty;

		/// <summary>
		/// Help index
		/// </summary>
		public string HelpItem
		{
			get
			{
				return helpItem;
			}
			set
			{
				helpItem = value;
			}
		}

		/// <summary>
		/// Process event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void btnHelp_Click(object sender, EventArgs e)
		{
			if (HelpItem != string.Empty)
			{
				HelpLabelForm frm = new HelpLabelForm();
				frm.txtMessage.Text = HelpProvider.Instance.Information(HelpItem);
				frm.ShowDialog();
			}
		}
	}
}
